---
title: "!="
layout: "default"
root: "/v5.1"
description: "Swift documentation for '!='"
keywords: ""
---

<div class="intro-declaration"><code class="language-swift">func !=(t0:t1:)(t0: Any.Type?, t1: Any.Type?) -> Bool</code></div><div class="discussion comment"><p>Returns a Boolean value indicating whether two types are not identical.
</p>
</div><div class="intro-declaration"><code class="language-swift">func !=(lhs:rhs:)(lhs: T, rhs: T) -> Bool</code></div><div class="discussion comment"><p>Returns a Boolean value indicating whether the two arguments are not equal.
</p>
</div><div class="intro-declaration"><code class="language-swift">func !=(lhs:rhs:)(lhs: T, rhs: T) -> Bool</code></div><div class="discussion comment"><p>Returns a Boolean value indicating whether the two arguments are not equal.
</p>
</div><div class="intro-declaration"><code class="language-swift">func !=(lhs:rhs:)(lhs: (), rhs: ()) -> Bool</code></div><div class="discussion comment"><p>Returns a Boolean value indicating whether any corresponding components of
the two tuples are not equal.
</p>
<p>All arity zero tuples are equal.</p>
</div><div class="intro-declaration"><code class="language-swift">func !=(lhs:rhs:)(lhs: (A, B), rhs: (A, B)) -> Bool</code></div><div class="discussion comment"><p>Returns a Boolean value indicating whether any corresponding components of
the two tuples are not equal.
</p>
<p>For two tuples to compare as equal, each corresponding pair of components
must be equal. The following example compares tuples made up of 2
components:</p>
<pre><code class="language-swift">let a = (&quot;a&quot;, 1)
let b = (&quot;a&quot;, 1)
print(a != b)
// Prints &quot;false&quot;

let c = (&quot;a&quot;, 2)
print(a != c)
// Prints &quot;true&quot;
</code></pre>
</div><div class="intro-declaration"><code class="language-swift">func !=(lhs:rhs:)(lhs: (A, B, C), rhs: (A, B, C)) -> Bool</code></div><div class="discussion comment"><p>Returns a Boolean value indicating whether any corresponding components of
the two tuples are not equal.
</p>
<p>For two tuples to compare as equal, each corresponding pair of components
must be equal. The following example compares tuples made up of 3
components:</p>
<pre><code class="language-swift">let a = (&quot;a&quot;, 1, 2)
let b = (&quot;a&quot;, 1, 2)
print(a != b)
// Prints &quot;false&quot;

let c = (&quot;a&quot;, 1, 3)
print(a != c)
// Prints &quot;true&quot;
</code></pre>
</div><div class="intro-declaration"><code class="language-swift">func !=(lhs:rhs:)(lhs: (A, B, C, D), rhs: (A, B, C, D)) -> Bool</code></div><div class="discussion comment"><p>Returns a Boolean value indicating whether any corresponding components of
the two tuples are not equal.
</p>
<p>For two tuples to compare as equal, each corresponding pair of components
must be equal. The following example compares tuples made up of 4
components:</p>
<pre><code class="language-swift">let a = (&quot;a&quot;, 1, 2, 3)
let b = (&quot;a&quot;, 1, 2, 3)
print(a != b)
// Prints &quot;false&quot;

let c = (&quot;a&quot;, 1, 2, 4)
print(a != c)
// Prints &quot;true&quot;
</code></pre>
</div><div class="intro-declaration"><code class="language-swift">func !=(lhs:rhs:)(lhs: (A, B, C, D, E), rhs: (A, B, C, D, E)) -> Bool</code></div><div class="discussion comment"><p>Returns a Boolean value indicating whether any corresponding components of
the two tuples are not equal.
</p>
<p>For two tuples to compare as equal, each corresponding pair of components
must be equal. The following example compares tuples made up of 5
components:</p>
<pre><code class="language-swift">let a = (&quot;a&quot;, 1, 2, 3, 4)
let b = (&quot;a&quot;, 1, 2, 3, 4)
print(a != b)
// Prints &quot;false&quot;

let c = (&quot;a&quot;, 1, 2, 3, 5)
print(a != c)
// Prints &quot;true&quot;
</code></pre>
</div><div class="intro-declaration"><code class="language-swift">func !=(lhs:rhs:)(lhs: (A, B, C, D, E, F), rhs: (A, B, C, D, E, F)) -> Bool</code></div><div class="discussion comment"><p>Returns a Boolean value indicating whether any corresponding components of
the two tuples are not equal.
</p>
<p>For two tuples to compare as equal, each corresponding pair of components
must be equal. The following example compares tuples made up of 6
components:</p>
<pre><code class="language-swift">let a = (&quot;a&quot;, 1, 2, 3, 4, 5)
let b = (&quot;a&quot;, 1, 2, 3, 4, 5)
print(a != b)
// Prints &quot;false&quot;

let c = (&quot;a&quot;, 1, 2, 3, 4, 6)
print(a != c)
// Prints &quot;true&quot;
</code></pre>
</div><div class="intro-declaration"><code class="language-swift">func !=(t0:t1:)(t0: Any.Type?, t1: Any.Type?) -> Bool</code></div><div class="discussion comment"><p>Returns a Boolean value indicating whether two types are not identical.
</p>
</div><div class="intro-declaration"><code class="language-swift">func !=(lhs:rhs:)(lhs: T, rhs: T) -> Bool</code></div><div class="discussion comment"><p>Returns a Boolean value indicating whether the two arguments are not equal.
</p>
</div><div class="intro-declaration"><code class="language-swift">func !=(lhs:rhs:)(lhs: T, rhs: T) -> Bool</code></div><div class="discussion comment"><p>Returns a Boolean value indicating whether the two arguments are not equal.
</p>
</div><div class="intro-declaration"><code class="language-swift">func !=(lhs:rhs:)(lhs: (), rhs: ()) -> Bool</code></div><div class="discussion comment"><p>Returns a Boolean value indicating whether any corresponding components of
the two tuples are not equal.
</p>
<p>All arity zero tuples are equal.</p>
</div><div class="intro-declaration"><code class="language-swift">func !=(lhs:rhs:)(lhs: (A, B), rhs: (A, B)) -> Bool</code></div><div class="discussion comment"><p>Returns a Boolean value indicating whether any corresponding components of
the two tuples are not equal.
</p>
<p>For two tuples to compare as equal, each corresponding pair of components
must be equal. The following example compares tuples made up of 2
components:</p>
<pre><code class="language-swift">let a = (&quot;a&quot;, 1)
let b = (&quot;a&quot;, 1)
print(a != b)
// Prints &quot;false&quot;

let c = (&quot;a&quot;, 2)
print(a != c)
// Prints &quot;true&quot;
</code></pre>
</div><div class="intro-declaration"><code class="language-swift">func !=(lhs:rhs:)(lhs: (A, B, C), rhs: (A, B, C)) -> Bool</code></div><div class="discussion comment"><p>Returns a Boolean value indicating whether any corresponding components of
the two tuples are not equal.
</p>
<p>For two tuples to compare as equal, each corresponding pair of components
must be equal. The following example compares tuples made up of 3
components:</p>
<pre><code class="language-swift">let a = (&quot;a&quot;, 1, 2)
let b = (&quot;a&quot;, 1, 2)
print(a != b)
// Prints &quot;false&quot;

let c = (&quot;a&quot;, 1, 3)
print(a != c)
// Prints &quot;true&quot;
</code></pre>
</div><div class="intro-declaration"><code class="language-swift">func !=(lhs:rhs:)(lhs: (A, B, C, D), rhs: (A, B, C, D)) -> Bool</code></div><div class="discussion comment"><p>Returns a Boolean value indicating whether any corresponding components of
the two tuples are not equal.
</p>
<p>For two tuples to compare as equal, each corresponding pair of components
must be equal. The following example compares tuples made up of 4
components:</p>
<pre><code class="language-swift">let a = (&quot;a&quot;, 1, 2, 3)
let b = (&quot;a&quot;, 1, 2, 3)
print(a != b)
// Prints &quot;false&quot;

let c = (&quot;a&quot;, 1, 2, 4)
print(a != c)
// Prints &quot;true&quot;
</code></pre>
</div><div class="intro-declaration"><code class="language-swift">func !=(lhs:rhs:)(lhs: (A, B, C, D, E), rhs: (A, B, C, D, E)) -> Bool</code></div><div class="discussion comment"><p>Returns a Boolean value indicating whether any corresponding components of
the two tuples are not equal.
</p>
<p>For two tuples to compare as equal, each corresponding pair of components
must be equal. The following example compares tuples made up of 5
components:</p>
<pre><code class="language-swift">let a = (&quot;a&quot;, 1, 2, 3, 4)
let b = (&quot;a&quot;, 1, 2, 3, 4)
print(a != b)
// Prints &quot;false&quot;

let c = (&quot;a&quot;, 1, 2, 3, 5)
print(a != c)
// Prints &quot;true&quot;
</code></pre>
</div><div class="intro-declaration"><code class="language-swift">func !=(lhs:rhs:)(lhs: (A, B, C, D, E, F), rhs: (A, B, C, D, E, F)) -> Bool</code></div><div class="discussion comment"><p>Returns a Boolean value indicating whether any corresponding components of
the two tuples are not equal.
</p>
<p>For two tuples to compare as equal, each corresponding pair of components
must be equal. The following example compares tuples made up of 6
components:</p>
<pre><code class="language-swift">let a = (&quot;a&quot;, 1, 2, 3, 4, 5)
let b = (&quot;a&quot;, 1, 2, 3, 4, 5)
print(a != b)
// Prints &quot;false&quot;

let c = (&quot;a&quot;, 1, 2, 3, 4, 6)
print(a != c)
// Prints &quot;true&quot;
</code></pre>
</div>